package com.siyue.controller;

import com.siyue.dto.WebCallDto;
import com.siyue.service.CallService;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.IOException;

@Controller
public class ApiController {

    @Resource
    CallService callService;


    /**
     * 登录
     * @return
     * @throws IOException
     */
    @PostMapping("/api/call")
    public ResponseEntity<?> login(@RequestBody WebCallDto webCallDto) throws IOException,Exception {
        callService.call(webCallDto.getToken(), webCallDto.getId(), webCallDto.getName(), webCallDto.getMobile());
        return ResponseEntity.ok().build();
    }
}
